]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
systray: Bail out if the plug window is gone
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 7 Sep 2016 11:25:24 +0000 (13:25 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Thu, 8 Sep 2016 10:08:02 +0000 (12:08 +0200)
Instead of crashing when deferencing a NULL pointer.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=755313

src/shell-tray-icon.c

index 2397117c73fdb16b270ddf733a786b07a0e56186..e80dd3e5ed4b5ce275ebacfed2f29cfb6eb2e477 100644 (file)
@@ -204,6 +204,12 @@ shell_tray_icon_click (ShellTrayIcon *icon,
   gdk_error_trap_push ();
 
   remote_window = gtk_socket_get_plug_window (GTK_SOCKET (icon->priv->socket));
+  if (remote_window == NULL)
+    {
+      g_warning ("shell tray: plug window is gone");
+      gdk_error_trap_pop_ignored ();
+      return;
+    }
   xwindow = GDK_WINDOW_XID (remote_window);
   xdisplay = GDK_WINDOW_XDISPLAY (remote_window);
   screen = gdk_window_get_screen (remote_window);